use cosmwasm_std::StdError;
use hex::FromHexError;
use thiserror::Error;

#[derive(Error, Debug, PartialEq)]
pub enum ContractError {
    #[error("{0}")]
    Std(#[from] StdError),

    #[error("{0}")]
    Hex(#[from] FromHexError),

    #[error("Unauthorized")]
    Unauthorized {},

    #[error("InvalidInput")]
    InvalidInput {},

    #[error("Not Reward or Stake token")]
    UnacceptableToken {},

    #[error("Not enough Stake")]
    NotEnoughStake {},

    #[error("No Reward")]
    NoReward {},

    #[error("No Staked")]
    NoStaked {},

    #[error("Not enough Reward")]
    NotEnoughReward {},

    #[error("Already claimed")]
    Claimed {},

    #[error("Wrong length")]
    WrongLength {},

    #[error("Map2List failed")]
    Map2ListFailed {},

    #[error("Cannot migrate from different contract type: {previous_contract}")]
    CannotMigrate { previous_contract: String },

    #[error("Count {count}")]
    Count { count: u64 },

    #[error("grant reward err")]
    GrandRewardErr {},

    #[error("Pool is exist")]
    PoolExistError {},

    #[error("Pool not exist")]
    PoolNotExistError {},

    #[error("StakePeriod not exist")]
    StakePeriodNotExistError {},
}
